		
		** Append all waves of data
		local i = 1 
		foreach wave in w1 w2 w3 {
			use "$dir/data/niger_`wave'_individual.dta", clear
			tostring(indiv), replace
			ren `wave'_* *
			gen wave="`wave'"
			
			if `i' > 1 {
				append using `data'
			}
			
			tempfile data
			save `data', replace
			
			local ++i
		}
		
		order wave, first
		
	** Age groups
		replace age=. if age<0
		gen age_group5=floor(age/5)*5
		gen age_group10=floor(age/10)*10
		
		replace age_group5=80 if age_group5>80 & !missing(age_group5)
		replace age_group10=80 if age_group10>80 & !missing(age_group10)
		
	** Any work
		gen work_any=worked_last7days if wave=="w2" | wave=="w3"
		replace work_any=worked_last30days if wave=="w1"
	
	** Lives alone
		gen lives_alone=(hh_size==1)
		
		ren illinj* ill_inj*

	** Disability

		gen disability=(																	 	 ///
			diff_seei==1 | 																	 	 ///
			diff_hear==1 | 																	     ///
			diff_walk_clim==1 | 															     ///
			diff_reme==1 | 																	     ///
			diff_self_care==1 |																	 ///
			diff_comm ==1																		 ///
			)
		replace disability=. if (														         ///
			missing(diff_seei) &																 ///
			missing(diff_hear) & 														     	 ///
			missing(diff_walk_clim) & 														 	 ///
			missing(diff_reme) &																 ///
			missing(diff_self_care) &														     ///
			missing(diff_comm)       															 ///
			)

		save "$dir/data/niger.dta", replace
	
	
